/* Markdown 样式 */

/* 基础样式 */
.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0 16px;
    max-width: 900px;
    margin: 0 auto;
}

/* 标题样式 */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.markdown-content h1 {
    font-size: 2.2em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color);
    margin-top: 0;
}

.markdown-content h2 {
    font-size: 1.65em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color);
}

.markdown-content h3 {
    font-size: 1.35em;
}

.markdown-content h4 {
    font-size: 1.15em;
}

.markdown-content h5 {
    font-size: 0.95em;
}

.markdown-content h6 {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* 段落和列表 */
.markdown-content p,
.markdown-content ul,
.markdown-content ol {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 2em;
}

.markdown-content ul ul,
.markdown-content ul ol,
.markdown-content ol ul,
.markdown-content ol ol {
    margin-top: 0;
    margin-bottom: 0;
}

.markdown-content li {
    margin-bottom: 0.25em;
}

.markdown-content li > p {
    margin-top: 16px;
}

/* 列表项标记样式 */
.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ul ul {
    list-style-type: circle;
}

.markdown-content ul ul ul {
    list-style-type: square;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content ol ol {
    list-style-type: lower-alpha;
}

.markdown-content ol ol ol {
    list-style-type: lower-roman;
}

/* 引用块 */
.markdown-content blockquote {
    padding: 0.8em 1em;
    border-left: 4px solid var(--border-accent);
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border-radius: 0 3px 3px 0;
}

.markdown-content blockquote > :first-child {
    margin-top: 0;
}

.markdown-content blockquote > :last-child {
    margin-bottom: 0;
}

/* 代码 */
.markdown-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 3px;
    background-color: var(--code-bg);
}

.markdown-content pre {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    word-wrap: normal;
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    border-radius: 6px;
    background-color: var(--code-block-bg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    overflow: visible;
}

/* 表格 */
.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
    overflow: auto;
    display: block;
    border-spacing: 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.markdown-content table th,
.markdown-content table td {
    padding: 8px 13px;
    border: 1px solid var(--border-color);
}

.markdown-content table tr {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.markdown-content table tr:nth-child(2n) {
    background-color: var(--bg-secondary);
}

.markdown-content table th {
    font-weight: 600;
    text-align: left;
    background-color: var(--table-header-bg);
}

/* 水平线 */
.markdown-content hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: var(--border-color);
    border: 0;
    border-radius: 2px;
}

/* 链接 */
.markdown-content a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.markdown-content a:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}

/* 图片 */
.markdown-content img {
    max-width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-primary);
    border-radius: 6px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 任务列表 */
.markdown-content input[type="checkbox"] {
    margin-right: 0.5em;
    margin-top: 0;
}

.markdown-content .task-list-item {
    list-style-type: none;
    margin-left: -1.5em;
}

/* 暗色主题变量 */
body.theme-dark {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --text-primary: #d4d4d4;
    --text-secondary: #a0a0a0;
    --border-color: #444;
    --border-accent: #565656;
    --code-bg: #2d2d2d;
    --code-block-bg: #1e1e2e;
    --link-color: #3794ff;
    --link-hover-color: #61aeff;
    --table-header-bg: #2d2d2d;
}

/* 亮色主题变量 */
body.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --border-accent: #cccccc;
    --code-bg: #f0f0f0;
    --code-block-bg: #f8f8f8;
    --link-color: #0366d6;
    --link-hover-color: #0056b3;
    --table-header-bg: #f0f0f0;
}

/* 思考块样式 */
.think {
    background-color: var(--bg-secondary);
    border-left: 3px solid var(--border-accent);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
    font-style: italic;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 提示块样式 */
.tip, .warning, .info, .success {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tip {
    background-color: rgba(65, 184, 131, 0.1);
    border-color: #41b883;
}

.warning {
    background-color: rgba(255, 174, 0, 0.1);
    border-color: #ffae00;
}

.info {
    background-color: rgba(56, 132, 255, 0.1);
    border-color: #3884ff;
}

.success {
    background-color: rgba(14, 203, 129, 0.1);
    border-color: #0ecb81;
}

/* 适配暗色和亮色主题的文本颜色 */
body.theme-dark .markdown-content {
    color: var(--text-primary);
}

body.theme-light .markdown-content {
    color: var(--text-primary);
}

/* 代码块语言标签 */
.markdown-content pre {
    position: relative;
    padding-top: 2.5em;
}

.markdown-content .code-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.3em 1em;
    background: var(--code-header-bg);
    border-bottom: 1px solid var(--border-color);
    border-radius: 6px 6px 0 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8em;
    color: var(--text-secondary);
}

body.theme-dark {
    --code-header-bg: #252526;
}

body.theme-light {
    --code-header-bg: #f0f0f0;
}

/* 键盘按键样式 */
.markdown-content kbd {
    display: inline-block;
    padding: 0.2em 0.4em;
    font-size: 0.85em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    line-height: 1;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    margin: 0 0.1em;
} 